/////////////////////////////////////////////////////////////////////////////
// Name:        wxtabpanel.cpp
// Purpose:     
// Author:      Stephen Whittle
// Modified by: 
// Created:     08/06/2009 20:27:09
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
#include "wxmudtextctrl.h"
////@end includes

#include "wxtabpanel.h"

////@begin XPM images
#include "connect.xpm"
#include "connect_greyed.xpm"
#include "disconnect.xpm"
#include "disconnect_greyed.xpm"
#include "fonts.xpm"
#include "add_bottom.xpm"
#include "add_top.xpm"
////@end XPM images


/*
 * wxTabPanel type definition
 */

IMPLEMENT_DYNAMIC_CLASS( wxTabPanel, wxPanel )


/*
 * wxTabPanel event table definition
 */

BEGIN_EVENT_TABLE( wxTabPanel, wxPanel )

////@begin wxTabPanel event table entries
////@end wxTabPanel event table entries

END_EVENT_TABLE()


/*
 * wxTabPanel constructors
 */

wxTabPanel::wxTabPanel()
{
    Init();
}

wxTabPanel::wxTabPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
{
    Init();
    Create(parent, id, pos, size, style);
}


/*
 * wxTabPanel creator
 */

bool wxTabPanel::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
{
////@begin wxTabPanel creation
    wxPanel::Create(parent, id, pos, size, style);
    CreateControls();
////@end wxTabPanel creation
    return true;
}


/*
 * wxTabPanel destructor
 */

wxTabPanel::~wxTabPanel()
{
////@begin wxTabPanel destruction
    GetAuiManager().UnInit();
////@end wxTabPanel destruction
}


/*
 * Member initialisation
 */

void wxTabPanel::Init()
{
////@begin wxTabPanel member initialisation
    m_MainPane = NULL;
    m_SubPane = NULL;
////@end wxTabPanel member initialisation
}


/*
 * Control creation for wxTabPanel
 */

void wxTabPanel::CreateControls()
{    
////@begin wxTabPanel content construction
    wxTabPanel* itemPanel1 = this;

    GetAuiManager().SetManagedWindow(this);

    m_MainPane = new wxAuiNotebook( itemPanel1, ID_AUINOTEBOOK, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE|wxAUI_NB_TOP );

    wxMudTextCtrl* itemRichTextCtrl3 = new wxMudTextCtrl( m_MainPane, ID_RICHTEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxWANTS_CHARS );
    m_MainPane->AddPage(itemRichTextCtrl3, _("Tab"), false);

    itemPanel1->GetAuiManager().AddPane(m_MainPane, wxAuiPaneInfo()
        .Name(_T("ID_AUINOTEBOOK")).Centre().CaptionVisible(false).CloseButton(false).DestroyOnClose(false).Resizable(true).Floatable(false));

    wxAuiToolBar* itemAuiToolBar4 = new wxAuiToolBar( itemPanel1, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_GRIPPER );
    wxBitmap itemtool5Bitmap(itemPanel1->GetBitmapResource(wxT("connect.png")));
    wxBitmap itemtool5BitmapDisabled(itemPanel1->GetBitmapResource(wxT("connect_greyed.png")));
    itemAuiToolBar4->AddTool(ID_TOOL, wxEmptyString, itemtool5Bitmap, itemtool5BitmapDisabled, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
    wxBitmap itemtool6Bitmap(itemPanel1->GetBitmapResource(wxT("disconnect.png")));
    wxBitmap itemtool6BitmapDisabled(itemPanel1->GetBitmapResource(wxT("disconnect_greyed.png")));
    itemAuiToolBar4->AddTool(ID_TOOL1, wxEmptyString, itemtool6Bitmap, itemtool6BitmapDisabled, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
    wxBitmap itemtool7Bitmap(itemPanel1->GetBitmapResource(wxT("fonts.png")));
    wxBitmap itemtool7BitmapDisabled;
    itemAuiToolBar4->AddTool(ID_TOOL2, wxEmptyString, itemtool7Bitmap, itemtool7BitmapDisabled, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
    wxBitmap itemtool8Bitmap(itemPanel1->GetBitmapResource(wxT("add_bottom.png")));
    wxBitmap itemtool8BitmapDisabled;
    itemAuiToolBar4->AddTool(ID_TOOL3, wxEmptyString, itemtool8Bitmap, itemtool8BitmapDisabled, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
    wxBitmap itemtool9Bitmap(itemPanel1->GetBitmapResource(wxT("add_top.png")));
    wxBitmap itemtool9BitmapDisabled;
    itemAuiToolBar4->AddTool(ID_TOOL4, wxEmptyString, itemtool9Bitmap, itemtool9BitmapDisabled, wxITEM_NORMAL, wxEmptyString, wxEmptyString, NULL);
    itemAuiToolBar4->Realize();
    itemPanel1->GetAuiManager().AddPane(itemAuiToolBar4, wxAuiPaneInfo()
        .ToolbarPane().Name(_T("Pane3")).Top().Layer(10).CaptionVisible(false).CloseButton(false).DestroyOnClose(false).Resizable(false).Gripper(true));

    m_SubPane = new wxAuiNotebook( itemPanel1, ID_AUINOTEBOOK1, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE|wxAUI_NB_TOP );

    wxMudTextCtrl* itemRichTextCtrl11 = new wxMudTextCtrl( m_SubPane, ID_MUDTEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxWANTS_CHARS );
    m_SubPane->AddPage(itemRichTextCtrl11, _("Tab"), false);

    wxMudTextCtrl* itemRichTextCtrl12 = new wxMudTextCtrl( m_SubPane, ID_MUDTEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxWANTS_CHARS );
    m_SubPane->AddPage(itemRichTextCtrl12, _("Tab"), false);

    itemPanel1->GetAuiManager().AddPane(m_SubPane, wxAuiPaneInfo()
        .Name(_T("Pane2")).Bottom().MinSize(wxSize(-1, 140)).CloseButton(false).DestroyOnClose(false).Resizable(true).MaximizeButton(true));

    GetAuiManager().Update();

////@end wxTabPanel content construction
}


/*
 * Should we show tooltips?
 */

bool wxTabPanel::ShowToolTips()
{
    return true;
}

/*
 * Get bitmap resources
 */

wxBitmap wxTabPanel::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin wxTabPanel bitmap retrieval
    wxUnusedVar(name);
    if (name == _T("connect.png"))
    {
        wxBitmap bitmap(connect_xpm);
        return bitmap;
    }
    else if (name == _T("connect_greyed.png"))
    {
        wxBitmap bitmap(connect_greyed_xpm);
        return bitmap;
    }
    else if (name == _T("disconnect.png"))
    {
        wxBitmap bitmap(disconnect_xpm);
        return bitmap;
    }
    else if (name == _T("disconnect_greyed.png"))
    {
        wxBitmap bitmap(disconnect_greyed_xpm);
        return bitmap;
    }
    else if (name == _T("fonts.png"))
    {
        wxBitmap bitmap(fonts_xpm);
        return bitmap;
    }
    else if (name == _T("add_bottom.png"))
    {
        wxBitmap bitmap(add_bottom_xpm);
        return bitmap;
    }
    else if (name == _T("add_top.png"))
    {
        wxBitmap bitmap(add_top_xpm);
        return bitmap;
    }
    return wxNullBitmap;
////@end wxTabPanel bitmap retrieval
}

/*
 * Get icon resources
 */

wxIcon wxTabPanel::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin wxTabPanel icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end wxTabPanel icon retrieval
}

